package org.file5.search;

import org.compass.core.converter.basic.AbstractBasicConverter;
import org.compass.core.mapping.ResourcePropertyMapping;
import org.compass.core.marshall.MarshallingContext;

import com.google.appengine.api.datastore.Text;

public class TextConverter extends AbstractBasicConverter <Text> {
	protected Text doFromString(String str, ResourcePropertyMapping resourcePropertyMapping, MarshallingContext context) {
		return new Text(str);
		}

	@Override
	protected String doToString(Text o,
			ResourcePropertyMapping resourcePropertyMapping,
			MarshallingContext context) {
		return o==null?"":o.getValue();
	}
}
